﻿using WeDonekRpc.Helper.Validate;

namespace Basic.FlowRemoteModel.FlowNode.Model
{
    public class FlowNodeSet
    {
        [EnumValidate("flow.node.type.error", typeof(FlowAuditType), 0)]
        public FlowAuditType AuditType
        {
            get;
            set;
        }

        /// <summary>
        /// 节点名称
        /// </summary>
        [NullValidate("flow.node.name.null")]
        [LenValidate("flow.node.name.len", 1, 50)]
        public string NodeName
        {
            get;
            set;
        }

        /// <summary>
        /// 审核限制时间
        /// </summary>
        public short? LimitTime
        {
            get;
            set;
        }
        /// <summary>
        /// 流程超时操作
        /// </summary>
        [EnumValidate("flow.node.time.out.opt.error", typeof(FlowTimeOutOpt))]
        public FlowTimeOutOpt TimeOutOpt
        {
            get;
            set;
        }

        public long? ToEmpId
        {
            get;
            set;
        }
        /// <summary>
        /// 审批意见是否必填
        /// </summary>
        public bool OpinionMust
        {
            get;
            set;
        }
        /// <summary>
        /// 会签是否通过最小数
        /// </summary>
        public short? MinAuditPass
        {
            get;
            set;
        }
        /// <summary>
        /// 会签通过数是否按照比例计算
        /// </summary>
        public bool IsRatio
        {
            get;
            set;
        }
        /// <summary>
        /// 会审未通过时
        /// </summary>
        public FlowOutNoPassOptMethod AuditNoPassOpt
        {
            get;
            set;
        }
        /// <summary>
        /// 进度值
        /// </summary>
        public short? ProgressVal
        {
            get;
            set;
        }
        /// <summary>
        /// 是否允许撤回
        /// </summary>
        public bool IsAllowCancel
        {
            get;
            set;
        }

        [EnumValidate("flow.node.audit.button.error", typeof(FlowAuditButton), isContain: true)]
        public FlowAuditButton AuditButton
        {
            get;
            set;
        }
        public bool IsSign
        {
            get;
            set;
        }
        public bool IsUpFile
        {
            get;
            set;
        }
        /// <summary>
        /// 是否对上传文件数字签名
        /// </summary>
        public bool IsUpFileSign
        {
            get;
            set;
        }
        /// <summary>
        /// 回退到的节点ID 为空=选择回退节点
        /// </summary>
        public long? BackNodeId
        {
            get;
            set;
        }
        /// <summary>
        /// 回退处理方式
        /// </summary>
        [EnumValidate("flow.node.back.method.error", typeof(FlowBackMethod))]
        public FlowBackMethod BackMethod
        {
            get;
            set;
        }
        /// <summary>
        /// 说明
        /// </summary>
        public string Show
        {
            get;
            set;
        }
        /// <summary>
        /// 消息通知范围
        /// </summary>
        [EnumValidate("flow.node.notice.range.error", typeof(FlowMsgNoticeRange))]
        public FlowMsgNoticeRange NoticeRange
        {
            get;
            set;
        }
    }
}
